package com.sharesrc.jdev.wiimotedemo;

import java.text.ParseException;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import wiiusej.NativeLibrariesLoader;

import com.sharesrc.jdev.wiimotedemo.common.constant.Themes;
import com.sharesrc.jdev.wiimotedemo.views.ContentType;
import com.sharesrc.jdev.wiimotedemo.views.MainFrame;

import de.javasoft.plaf.synthetica.SyntheticaBlueSteelLookAndFeel;
import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel;

public class Launcher {

	static {
		String[] li = { "Licensee=JYLOO Software", "LicenseRegistrationNumber=------", "Product=Synthetica", "LicenseType=For internal tests only", "ExpireDate=--.--.----", "MaxVersion=2.999.999" };
		UIManager.put("Synthetica.license.info", li);
		UIManager.put("Synthetica.license.key", "A90D3B2B-53186981-0ED9A1C2-F00601BF-889A89BA");

		String[] li2 = { "Licensee=JYLOO Software", "LicenseRegistrationNumber=------", "Product=SyntheticaAddons", "LicenseType=For internal tests only", "ExpireDate=--.--.----", "MaxVersion=1.999.999" };
		UIManager.put("SyntheticaAddons.license.info", li2);
		UIManager.put("SyntheticaAddons.license.key", "CC98A980-13381C7D-30604C91-F5BC5376-776C6006");

		try {
			UIManager.setLookAndFeel(new SyntheticaBlueSteelLookAndFeel());
			UIManager.put("Synthetica.button.border.FlatButton", "standard/images/dummy.png");
			SyntheticaLookAndFeel.setFont(Themes.Fuente.DEFAULT_TEXT);
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		NativeLibrariesLoader.load();
		final MainFrame gui = new MainFrame();
		WiiUseJ.INSTANCE.init(gui);
		Wiigee.INSTANCE.init(gui);
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				gui.switchContent(ContentType.TRAINING);
				gui.setVisible(true);
			}
		});
	}
}
